package cn.pugle.base.net.socket.client;

import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;

/**
 * Created by tzp on 2015/12/14.<br/>
 */
public class CONS {
    public static final String CHARSET_NAME = "UTF-8";
    public static final String SERVER_ADDRESS = "localhost";
    public static final int SERVER_PORT = 38080;
    public static InetAddress inetAddress;
    public static InetSocketAddress inetSocketAddress;

    public static final String[] MESSAGES = new String[]{//一条整好10个bytes, 加上tail\n一共45
            "message A\n",
            "message B\n",
            "message C\n",
            "message D\n"
    };
    public static final String PROTOCOL_TAIL = "TAIL";//后面还再接一个\n
    static {
        try {
            inetAddress = InetAddress.getByName(SERVER_ADDRESS);
            inetSocketAddress = new InetSocketAddress(inetAddress, SERVER_PORT);
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
    }
}
